using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using Stratman.Utilities;

namespace Stratman.DesktopProcess.DatabaseSynchronizer
{
    /// <summary>
    /// Takes two pre-existing databases and compares them, upgrading the schema and data of the
    /// target database to be equivalent to that of the source database.
    /// </summary>
    public class DatabaseToDatabaseProject : SynchronizerProject
    {
        /// <summary>
        /// Loads settings for the synchronization operation from a project file.
        /// </summary>
        /// <param name="projectFilePath">
        /// Project file from which we are to load our settings.
        /// </param>
        /// <param name="commandLineArguments">
        /// Command line arguments that were specified.
        /// </param>
        protected override void LoadFromFile(string projectFilePath, string[] commandLineArguments)
        {
            synchronizationOptions.Load(projectFilePath);
        }

        /// <summary>
        /// Upgrades the target database to make its schema and data equivalent to that of the
        /// source database.
        /// </summary>
        public override void Execute()
        {
            SynchronizeTwoDatabases(synchronizationOptions);
        }
    }
}
